package com.yj_app.qualitytest.activity.login.model;

import com.yj_app.qualitytest.activity.login.contract.LoginContract;
import com.yj_app.qualitytest.base.mvp.BaseModelImpl;
import com.yj_app.qualitytest.callback.DialogCallback;
import com.yj_app.qualitytest.common.NetConfig;
import com.yj_app.qualitytest.info.BaseInfo;
import com.yj_app.qualitytest.info.CompanyInfo;

import java.util.List;

public class LoginModel extends BaseModelImpl implements LoginContract.Model {
    @Override
    public void getCompanies(DialogCallback<BaseInfo<List<CompanyInfo>>> stringDialogCallback) {
        get(NetConfig.GET_COMPANIES,stringDialogCallback,"tablename","Qcorp");
    }

    @Override
    public void getLoginfo(String username, String userpwd, DialogCallback<String> stringDialogCallback) {
        get(NetConfig.LOGIN_INFO,stringDialogCallback,"usercode",username,"userpass",userpwd);


    }

    @Override
    public void getLoginfo2(String msg2json, DialogCallback<String> stringDialogCallback) {
        getMsgCommon(msg2json,stringDialogCallback);
    }

    @Override
    public void getCompanies2(String msg2json, DialogCallback<String> stringDialogCallback) {
        getMsgCommon(msg2json,stringDialogCallback);
    }
}
